package com.wbk.lotterysystemuserservice.controller.auth;

import com.wbk.lotterysystemuserservice.commons.bo.StoreApplyBO;
import com.wbk.lotterysystemuserservice.commons.dto.StoreDTO;
import com.wbk.lotterysystemuserservice.controller.auth.biz.StoreApplyBiz;
import com.wbk.user.vo.StoreVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import result.Result;

import javax.validation.Valid;

@Api
@RestController
@RequestMapping("/user/api/auth/store")
public class StoreApplyController {

    @Autowired
    StoreApplyBiz storeApplyBiz;

    @ApiOperation(value = "申请商家认证接口", notes = "申请商家认证")
    @PostMapping("/apply")
    public Result<StoreDTO> apply(@Valid @RequestBody StoreApplyBO storeApplyBO) {
        return storeApplyBiz.apply(storeApplyBO);
    }

    @ApiOperation(value = "商家信息接口", notes = "商家信息")
    @GetMapping("/storeDetail/{storeUserNo}")
    public Result<StoreVO> storeDetail(@ApiParam(value = "用户编号", required = true) @PathVariable("storeUserNo") Long storeUserNo) {
        return storeApplyBiz.storeDetail(storeUserNo);
    }

}
